package net.sapfree.core.util.format;

import java.math.BigDecimal;


public class JavaLongFormat extends ValueObjectFormat 
{
	public int getInt(Object value)
	{
		return value == null ? 0 : ((Long)value).intValue();
	}
	
	public long getLong(Object value)
	{
		return value == null ? 0 : ((Long)value).longValue();
	}
	
	public String getString(Object value,String defaultValue)
	{
		return value == null ? defaultValue : String.valueOf(((Long)value).longValue());
	}
	
	public String getString(Object value,String defaultValue,String formatString)
	{
		return value == null ? defaultValue : String.valueOf(((Long)value).longValue());
	}
	
	public BigDecimal getBigDecimal(Object value)
	{
		return value == null ? BigDecimal.ZERO : BigDecimal.valueOf((Long)value);
	}
}
